import request from '@/utils/request'

export function getCourseCategoryList(query) {
  return request({
    url: '/course-categories',
    method: 'get',
    params: query
  })
}

export function getCourseCategory(id) {
  return request({
    url: `/course-categories/${id}/edit`,
    method: 'get'
  })
}

export function createCourseCategory(data) {
  return request({
    url: '/course-categories',
    method: 'post',
    data
  })
}

export function UpdateStatus(data) {
  return request({
    url: '/course-categories/UpdateStatus',
    method: 'post',
    data
  })
}

export function updateCourseCategory(id, data) {
  return request({
    url: `/course-categories/${id}`,
    method: 'put',
    data
  })
}

export function deleteCourseCategory(id) {
  return request({
    url: `/course-categories/${id}`,
    method: 'delete'
  })
}

export function getParentCategories() {
  return request({
    url: `/course-categories/parents`,
    method: 'get'
  })
}

export function getChildCategories(id) {
  return request({
    url: `/course-categories/${id}/childs`,
    method: 'get'
  })
}

export function Classify(id) {
  return request({
    url: `/members/${id}`,
    method: 'delete'
  })
}
